Nanostructures often exhibit fascinating physical properties not present in their bulk counterparts. Optical properties of nanostructures have been one of the recent research focuses. Tuning optical properties of nanostructures would facilitate their applications in the semiconductor, optics, and consumer electronics industry. In one example, optical properties of nanostructures can be controlled by their chemical composition. Chemical doping can change electronic structures of the materials semiconductor nanostructures are composed of, which in turn changes their interaction with light. In another example, arranging nanostructures into a regular lattice can yield optical properties individual nanostructures lack. However, these conventional approaches often require complex chemical synthesis or post-synthesis manipulation, and thus are less robust against minute variations of conditions and cannot easily and accurately position nanostructures in a functional device. In contrast, the approach described herein overcomes these problems of the conventional approaches by harnessing small physical sizes of nanostructures and a top-down fabrication process (i.e., part of a piece of bulk material is removed until desired nanostructures are achieved).